﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class RotationPlatform3 : MonoBehaviour {


    public float duration = 1f;
    public float delay = 5f;

    private void Start() {

        OnComplete();

    }

    void OnComplete() {
        transform.DOKill();
        Sequence sequence = DOTween.Sequence();
        sequence.Append(transform.DOLocalRotateQuaternion(Quaternion.Euler(0, 0, 90f) * transform.localRotation, duration)
                 .SetDelay(delay));
        sequence.Append(transform.DOLocalRotateQuaternion(transform.localRotation, duration)
                 .SetDelay(delay));
        sequence.OnComplete(OnComplete);
        sequence.PlayForward();
    }
}
